package cn.gson.boot.model.dao;

import cn.gson.boot.model.pojos.Huanhuo;
import cn.gson.boot.model.pojos.Huanhuoxiangqing;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;

public interface HuanHuoXiangQinDao extends CrudRepository<Huanhuoxiangqing,Integer> {
    //修改后台时会重复新增合同详情，所以先根据合同id删除一下
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "delete from huanhuoxiangqing where hh_id = ?1")
    public void deleteHuanHuoXiangQing(Integer hhId);
}
